package com.aya.simple.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.event.ApplicationEventMulticaster;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SimpleMain {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        ApplicationEventMulticaster publisher = applicationContext.getBean(ApplicationEventMulticaster.class);
        WeatherSubject weatherSubject = new WeatherSubject("");
        weatherSubject.setHumidity("10");
        weatherSubject.setTemperature("20");
        applicationContext.publishEvent(weatherSubject);
    }
}
